package com.lw.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 *  表定义层。
 *
 * @author lw
 * @since 2025年04月29日 11:35:15
 */
public class TbKeyTableDef extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public static final TbKeyTableDef TB_KEY = new TbKeyTableDef();

    
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 名称
     */
    public final QueryColumn NAME = new QueryColumn(this, "name");

    /**
     * 密钥文件路径
     */
    public final QueryColumn PATH = new QueryColumn(this, "path");

    /**
     * 类型
     */
    public final QueryColumn TYPE = new QueryColumn(this, "type");

    /**
     * mac地址
     */
    public final QueryColumn MAC_ID = new QueryColumn(this, "mac_id");

    /**
     * 状态
     */
    public final QueryColumn STATUS = new QueryColumn(this, "status");

    /**
     * 密钥编号
     */
    public final QueryColumn KEY_NUMBER = new QueryColumn(this, "key_number");

    
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 有效日期
     */
    public final QueryColumn EXPIRY_DATE = new QueryColumn(this, "expiry_date");

    /**
     * 服务器名称
     */
    public final QueryColumn SERVER_NAME = new QueryColumn(this, "server_name");

    
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 服务对象名称
     */
    public final QueryColumn SERVICE_NAME = new QueryColumn(this, "service_name");

    /**
     * 生效日期
     */
    public final QueryColumn EFFECTIVE_DATE = new QueryColumn(this, "effective_date");

    /**
     * 加密方式
     */
    public final QueryColumn ENCRYPTION_METHOD = new QueryColumn(this, "encryption_method");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, NAME, KEY_NUMBER, TYPE, SERVICE_NAME, SERVER_NAME, CREATE_TIME, UPDATE_TIME, STATUS, MAC_ID, EFFECTIVE_DATE, EXPIRY_DATE, ENCRYPTION_METHOD, PATH};

    public TbKeyTableDef() {
        super("", "tb_key");
    }

    private TbKeyTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public TbKeyTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new TbKeyTableDef("", "tb_key", alias));
    }

}
